<%@page import="com.zx.oa.entity.ClassInfo" %>
<%@page import="com.zx.oa.utils.PageSupport" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ include file="../common/header.jsp" %>
<%@page import="com.zx.oa.service.student.StudentService" %>
<%@page import="com.zx.oa.service.student.StudentService" %>
<%@page import="com.zx.oa.entity.Student" %>
<%@page import="java.util.List" %>
<%@page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath }"></c:set>
<script src="js/jquery-3.5.1.js" type="text/javascript"></script>
<style>
    .bbtt {
        margin-left: 87px;
        margin-top: 10px;
    }
</style>
<script>
    function confirmAct() {
        if (confirm('确定要执行删除操作吗?')) {
            return true;
        }
        return false;
    }
</script>
<!-- appInfoList页面开始 -->
<div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">
            <h2>
                市场类学生管理<i class="fa fa-user"></i> ${loginName }
            </h2>
            <!--  -->
            <div class="x_content">
                <br/>
                <form id="query" data-parsley-validate
                      class="form-horizontal form-label-left" method="post"
                      action="marketTypeStudentServlet.do?param=cha">
                    <ul style="list-style: none; display: inline-block;">
                        <li><label class="control-label col-md-3 col-sm-3 col-xs-12"
                        >市场类型 </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <select name="stuType" value="" id="stuType"
                                        class="form-control col-md-7 col-xs-12">
                                    <option value="">---请选择---</option>
                                    <c:forEach var="type" items="${typeList}">
                                        <option value="${type}" ${param.stuType==type?'selected':''}>${type}</option>
                                    </c:forEach>
                                </select>
                            </div>
                        </li>
                        <li>
                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12"
                                >班级 </label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                    <select name="classname" id="classname" value=""
                                            class="form-control col-md-7 col-xs-12">
                                        <option value="">---请选择---</option>
                                        <c:forEach var="stu" items="${marketClassList}">
                                            <option value="${stu.className}" ${param.classname==stu.className?'selected':''}>${stu.className}</option>
                                        </c:forEach>
                                    </select>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12"
                                >培训意向 </label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                    <select name="intention" id="intention" value=""
                                            class="form-control col-md-7 col-xs-12">
                                        <option value="">---请选择---</option>
                                        <c:forEach var="intention" items="${intentionList}">
                                            <option value="${intention}" ${param.intention==intention?'selected':''}>${intention}</option>
                                        </c:forEach>
                                    </select>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12">姓名
                                </label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                    <input type="text" name="namec" value="${param.namec==null?'':param.namec}"
                                           class="form-control col-md-7 col-xs-12">
                                </div>
                            </div>
                        </li>
                        <br/>
                        <li>
                            <div class="form-group">
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                    <button type="submit" class="btn btn-primary bbtt"
                                            class="btn btn-success ">查&nbsp;&nbsp;&nbsp;&nbsp;询
                                    </button>
                                </div>
                            </div>
                        </li>
                    </ul>
                </form>
            </div>
        </div>
        <!-- 表格 -->
        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
                <a href="marketTypeStudentServlet.do?param=add_cha" class="btn btn-success btn-sm">注册学生信息</a>
                <a href="marketTypeStudentServlet.do?param=excel" class="btn btn-success btn-sm">导出学生信息</a>
                <table id="datatable" class="table table-striped table-bordered">
                    <tr>
                        <th>编号</th>
                        <th>姓名</th>
                        <th>班级名称</th>
                        <th>来自学校</th>
                        <th>学历</th>
                        <th style="width: 125px;">操作</th>
                    </tr>
                    <c:forEach var="stu" items="${showMarketStudentList}">
                        <tr>
                            <td>${ stu.id }</td>
                            <td>${ stu.studentName }</td>
                            <td>${ stu.className }</td>
                            <td>${ stu.fromSchool }</td>
                            <td>${ stu.education }</td>
                            <td>
                                <div class="btn-group">
                                    <button type="button" class="btn btn-danger">点击操作</button>
                                    <button type="button" class="btn btn-danger dropdown-toggle"
                                            data-toggle="dropdown" aria-expanded="false">
                                        <span class="caret"></span> <span class="sr-only">Toggle
											Dropdown</span>
                                    </button>
                                    <ul class="dropdown-menu" role="menu">
                                        <li><a
                                                href="marketTypeStudentServlet.do?param=modify_cha&id=${stu.id}&pageIndex=${pageInfo.currentPageNo}&namec=${name==null?'':name}&classname=${param.classname==null?'':param.classname}&stuType=${param.stuType==null?'':param.stuType}&intention=${param.intention==null?'':param.intention}"
                                                data-toggle="tooltip" data-placement="top"
                                                data-original-title="修改学生信息">修改</a></li>
                                        <li>
                                            <a href="marketTypeStudentServlet.do?param=del&id=${stu.id}&pageIndex=${pageInfo.currentPageNo}&namec=${name==null?'':name}&classname=${param.classname==null?'':param.classname}&stuType=${param.stuType==null?'':param.stuType}&intention=${param.intention==null?'':param.intention}"
                                               data-toggle="tooltip" data-placement="top"
                                               data-original-title="删除学生信息" onclick="return confirmAct();">删除</a></li>
                                        <li><a href="marketTypeStudentServlet.do?param=select&id=${stu.id}&className=${ stu.className }&pageIndex=${pageInfo.currentPageNo}&namec=${name==null?'':name}&classname=${param.classname==null?'':param.classname}&stuType=${param.stuType==null?'':param.stuType}&intention=${param.intention==null?'':param.intention}"
                                               data-toggle="tooltip" data-placement="top"
                                               data-original-title="查看学生信息">查看</a></li>
                                    </ul>
                                </div>
                            </td>
                        </tr>
                    </c:forEach>
                    <tr>
                        <td colspan="10" style="text-align: right;">
                            <span>共有${pageInfo.totalCount }条数据，${pageInfo.currentPageNo }/${pageInfo.totalPageCount }页</span>
                            <a
                                    href="marketTypeStudentServlet.do?param=cha&pageIndex=1&namec=${name==null?'':name}&classname=${param.classname==null?'':param.classname}&stuType=${param.stuType==null?'':param.stuType}&intention=${param.intention==null?'':param.intention}">首页</a>&nbsp;
                            <c:choose>
                                <c:when test="${pageInfo.currentPageNo ==1}">
                                    <a
                                            href="marketTypeStudentServlet.do?param=cha&pageIndex=1&namec=${name==null?'':name}&classname=${param.classname==null?'':param.classname}&stuType=${param.stuType==null?'':param.stuType}&intention=${param.intention==null?'':param.intention}">上一页</a>&nbsp;
                                </c:when>
                                <c:otherwise>
                                    <a
                                            href="marketTypeStudentServlet.do?param=cha&pageIndex=${pageInfo.currentPageNo-1}&namec=${name==null?'':name}&classname=${param.classname==null?'':param.classname}&stuType=${param.stuType==null?'':param.stuType}&intention=${param.intention==null?'':param.intention}">上一页</a>&nbsp;
                                </c:otherwise>
                            </c:choose>
                            <c:choose>
                                <c:when test="${pageInfo.currentPageNo==pageInfo.totalPageCount}">
                                    <a
                                            href="marketTypeStudentServlet.do?param=cha&pageIndex=${pageInfo.totalPageCount}&namec=${name==null?'':name}&classname=${param.classname==null?'':param.classname}&stuType=${param.stuType==null?'':param.stuType}&intention=${param.intention==null?'':param.intention}">下一页</a>&nbsp;
                                </c:when>
                                <c:otherwise>
                                    <a
                                            href="marketTypeStudentServlet.do?param=cha&pageIndex=${pageInfo.currentPageNo+1}&namec=${name==null?'':name}&classname=${param.classname==null?'':param.classname}&stuType=${param.stuType==null?'':param.stuType}&intention=${param.intention==null?'':param.intention}">下一页</a>&nbsp;
                                </c:otherwise>
                            </c:choose>
                            <a
                                    href="marketTypeStudentServlet.do?param=cha&pageIndex=${pageInfo.totalPageCount}&namec=${name==null?'':name}&classname=${param.classname==null?'':param.classname}&stuType=${param.stuType==null?'':param.stuType}&intention=${param.intention==null?'':param.intention}">末页</a>
                        </td>
                    </tr>
                </table>
            </div>
        </div>

        <!-- appInfoList页面结束 -->
        <!-- /page content -->
        <%@ include file="../common/footer.jsp" %>
        <script src="${ctx }/statics/localjs/marketStudentAjax.js"></script>

